

import java.util.HashMap;
import java.util.Iterator;

public class MaxPointOnALine {

	static class Point {
		int x;
		int y;

		Point() {x = 0;y = 0;}
		Point(int a, int b) {x = a;y = b;}
	}

	public static int maxPoints(Point[] points) {
        if(points==null || points.length==0) return 0;
        int ret = 1;
        HashMap<Double, Integer> map = new HashMap<Double, Integer>();
        for(int i=0;i<points.length;++i){
        	map.clear();
            int dup = 0;
            map.put(Double.MIN_VALUE,1);
            for(int j=i+1;j<points.length;++j){
            	if(points[j].x==points[i].x && points[j].y==points[i].y){
            		++dup;
            		continue;
            	}
                double k = points[j].x==points[i].x ? Double.MAX_VALUE :
                            (double) (points[j].y-points[i].y)/(points[j].x-points[i].x)+0.0;
                if(map.containsKey(k)){
                    map.put(k,map.get(k)+1);
                }
                else{
                    map.put(k,2);
                }
            }
            Iterator<Integer> itr = map.values().iterator();
            while(itr.hasNext()){
            	int temp = itr.next();
            	if(temp+dup>ret) ret = temp+dup;
            }
        }
        
        return ret;
    }
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Point a1 = new Point(0,3);
		Point a2 = new Point(3,3);
		Point a3 = new Point(-5,3);
		Point[] test = new Point[3];
		test[0] = a1;
		test[1] = a2;
		test[2] = a3;
		System.out.println(maxPoints(test));
		
	}

}
